<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRulesGroupDetailTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('rules_group_detail', function (Blueprint $table) {

            $table->timestamps();

            $table->integer('uid')->nullable(false)->comment('管理员id');

            $table->integer('rules_group_id')->nullable(false)->comment('分组id');

            $table->unique(['uid','rules_group_id']);


        });

        DB::statement("ALTER TABLE `rules_group_detail` COMMENT='分组详情表'");//表注释
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('rules_group_detail');
    }
}
